<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8" isELIgnored="false"%>

<html>
<body>

<script src="/js/jquery.min.js"></script>


<h2>Hello World!</h2>
<label>username</label><input id="username" type="text"><br>
<label>password</label><input id="password" type="text"><br>
<button id="loginIn">login in</button>


</body>
</html>

<script src="http://www.wodexiangce.cn/js/jquery-1.11.3.min.js" type="text/javascript"></script>


<script type="text/javascript">


    $("#loginIn").click(function(){

        var username = $("#username").val();
        var password = $("#password").val();
        // alert($("#username").val());
        // alert($("#password").val());



        if (username=="admin"&&password=="admin" ) {
            // 保存数据到sessionStorage
            sessionStorage.setItem('username', 'admin');
            sessionStorage.setItem('password', 'admin');

            $.ajax({

                type: 'POST',
                url: '/resume/addSession',
                // data:JSON.stringify(data),
                contentType:'application/json',
                dataType:"json",
                async: false

            });

            window.location.href = 'http://localhost:8080/resume/ResumeList';
        }else{
            alert("用户名或密码输入错误，请重试！")
        }

    });




</script>